@extends('layouts.app')

@section('title', isset($category->name)?translate($category, 'name'):translate('分类'))
@section('content')
@include('common.header', ['title'=> isset($category->name)?translate($category, 'name'):translate('分类')])
<link href="/fontpage/css/mui.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/fontpage/css/felei.css">
<div class="mui-content mui-row mui-fullscreen search-menu">
    <div class="mui-col-xs-3">
        <div id="segmentedControls" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-vertical">

@foreach($menu as $row)

                        <a class="mui-control-item 
                        @if(!empty($category) && $category->id == $row['id'])
                        mui-active
                        @endif
                        " href="{{JpUrl('good?catid='.$row['id'])}}">
                               {{translate($row, 'name')}}
                        </a>
                
@endforeach
            

        </div>
    </div>
    <div id="segmentedControlContents" class="mui-col-xs-9">

        <div class="mui-control-content">
		@if(isset($category) && !empty($category) && isset($menu[$category->id]) && $category->id>0 && isset($menu[$category->id]['children']))
            @foreach($menu[$category->id]['children'] as $row)

                <h2>
                    <a href="{{JpUrl('good/list?catid='.$row['id'])}}">
                        <span class="fl"> {{translate($row, 'name')}}</span>
                    </a>
                    <a href="{{JpUrl('good/list?catid='.$row['id'])}}" class="fr">
                        <img class="youjiantou" src="/fontpage/img/youjiantou.png">
                    </a>
                </h2>
                @if(isset($row['children']))
                
                    @foreach($row['children'] as $r)
                        <a href="{{JpUrl('good/list?catid='.$r['id'])}}">
                            <li class="mui-table-view-cell">
                                <img src="{{url('upload/'.$r['thumb'])}}">
                                <p>
                                    {{translate($r, 'name')}}
                                </p>
                            </li>
                        </a>
                    @endforeach
                 @endif   
                       
            @endforeach
		@endif
        </div>

        <div style="width: 100%;height: 50px;"></div>
    </div>
</div>
@endsection
@section('footer')
     @include('common.footer')
@stop
